import request from "@/apis/request";

export const getPageUnits = async (unitCode, unitName, currentPage, pageSize) => {

    console.log("unitCode", unitCode)
    console.log("unitName", unitName)
   
    return await request.get('/api/unit/find',
        {
            params: {
                unitCode: unitCode,
                unitName: unitName,
                currentPage: currentPage,
                pageSize: pageSize
            }
        })
}

export const addUnit = async (form) => {
    return await request.post('/api/unit/insert', form)
}
export const updateUnit = async (form) => {
    return await request.put('/api/unit/update', form)
}

export const deleteUnit = async (id) => {
    console.log("id", id)
    return await request.delete('/api/unit/delete', { data: id })
}